//
//  SurpiseDetailSetionHeard.swift
//  XiaoJingMallSwift
//
//  Created by beisheng03 on 2017/8/16.
//  Copyright © 2017年 beisheng. All rights reserved.
//

import UIKit

class SurpiseDetailSetionHeard: BaseTableHeaderFooterView {

    
    var rightStr : String?{
        
        
        didSet{
            
            
            if self.rightStr != nil {
                
                self.rightLabel.text = rightStr
                
                self.rightLabel.sizeToFit()
            }
            
            
        }
        
    }
    
    
    lazy var leftLabel : UILabel = {
        
        let temp = UILabel()
        
        temp.font = UIFont.systemFont(ofSize: 16)
        
        temp.textColor = UIColor.black
        
        temp.text = "本期参与者"
        
        temp.sizeToFit()
        
        
        return temp
        
    }()
    
    
    lazy var rightLabel : UILabel = {
        
        let temp = UILabel()
        
        temp.font = UIFont.systemFont(ofSize: 15)
        
        temp.textColor = UIColor.dakGray()
        
        return temp
        
    }()
    
    
    lazy var lineView : UIView = {
        
        let temp = UIView(frame: CGRect(x: 0, y: 35.4, width: KScreenW, height: 0.6))
        
        temp.backgroundColor = UIColor.lineGray()
        
        return temp
        
    }()
    
    
    
    
    lazy var bgView : UIView = {
        
        let temp = UIView(frame: CGRect(x: 0, y: 0, width: KScreenW, height: 36))
        
        temp.backgroundColor = UIColor.white
        
        temp.addSubview(self.leftLabel)
        temp.addSubview(self.rightLabel)
        temp.addSubview(self.lineView)
        
        return temp
        
    }()
      
    
    override init(reuseIdentifier: String?) {
        
        super.init(reuseIdentifier: reuseIdentifier)
        
        contentView.addSubview(bgView)
        
    }
    
    
    
    override func layoutSubviews() {
        super.layoutSubviews()
        self.leftLabel.frame.origin.x = 10
        self.leftLabel.center.y = 36 * 0.5
        self.rightLabel.center.y = 36 * 0.5
        self.rightLabel.frame.origin.x = KScreenW - self.rightLabel.frame.size.width - 10
        
    }
    
    
    
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    

}
